cca53713026cf33f21aea992d0811a657cb70fdd,portal-impl/src/com/liferay/portal/staging/StagingImpl.java,StagingImpl,publishToLive,#PortletRequest#Portlet#,603

Before Change


		Group stagingGroup = sourceLayout.getGroup();
		Group liveGroup = stagingGroup.getLiveGroup();

		Layout targetLayout = LayoutLocalServiceUtil.getLayout(
			liveGroup.getGroupId(), sourceLayout.isPrivateLayout(),
			sourceLayout.getLayoutId());

		copyPortlet(
			portletRequest, stagingGroup.getGroupId(), liveGroup.getGroupId(),

After Change



		long scopeGroupId = PortalUtil.getScopeGroupId(portletRequest);

		if (sourceLayout.hasScopeGroup() &&
			(sourceLayout.getScopeGroup().getGroupId() == scopeGroupId)) {

			stagingGroup = sourceLayout.getScopeGroup();
			liveGroup = stagingGroup.getLiveGroup();

			targetLayout = LayoutLocalServiceUtil.getLayout(
				liveGroup.getClassPK());
		}
		else {
			stagingGroup = sourceLayout.getGroup();
			liveGroup = stagingGroup.getLiveGroup();

			targetLayout = LayoutLocalServiceUtil.getLayout(
				liveGroup.getGroupId(), sourceLayout.isPrivateLayout(),
				sourceLayout.getLayoutId());
		}

		copyPortlet(